package com.scuthnweb.action.reslinkmodule;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.scuthnweb.domain.transfer.ResLinkList;
import com.scuthnweb.service.ResLinkModule;

public class CheckUserResLinkAction extends ActionSupport{
	
	private Integer pageSize;	
	private Integer page;
	
	private ResLinkModule resLinkModule;

	private List result;
	private Long count;
	
	public String execute(){
		ActionContext ctx = ActionContext.getContext();
		if(pageSize==null||page==null||page<0||pageSize<=0)
			return ERROR;
		else{
			Integer uid = (Integer)ctx.getSession().get("user_id");
			ResLinkList rls = this.resLinkModule.checkUserResLink(uid, pageSize, page);
			this.setResult(rls.getReslink());
			this.setCount(rls.getCount());
			return SUCCESS;
		}
	}
	
	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public ResLinkModule getResLinkModule() {
		return resLinkModule;
	}

	public void setResLinkModule(ResLinkModule resLinkModule) {
		this.resLinkModule = resLinkModule;
	}

	public List getResult() {
		return result;
	}

	public void setResult(List result) {
		this.result = result;
	}

	public Long getCount() {
		return count;
	}

	public void setCount(Long count) {
		this.count = count;
	}
}
